<%@ taglib prefix="s" uri="/struts-tags"%>
<%@taglib prefix="sj" uri="/struts-jquery-tags"%>
<%@taglib prefix="sjg" uri="/struts-jquery-grid-tags"%>
<script>
	$.subscribe('choosePic', function(event, data) {
		//alert($("#imgOriginal").attr("src"));
		$("#fileName").attr("value", $("#originalFileName").attr("value"));
		$("#previewImg").append(
				"<img src='" + $("#imgOriginal").attr("src") + "'>");
	});

	$.subscribe('clearDialog', function(event, data) {
		$("#uploadDialog").html("");
	});
</script>

<s:url id="urlUpload" action="modul/ourbusiness/page/uploader" />

<sj:dialog id="uploadDialog" autoOpen="false" modal="true"
	title="Upload Image" width="600" height="500" closeTopics="closeDialog" />


<s:form id="updateForm" theme="bootstrap" cssClass="well"
	label="Our Business" method="post">
	<s:hidden name="id" value="%{ourBusiness.id}"></s:hidden>
	<div class="row-fluid">
		<div class="span12">
			<table>
				<tr>
					<td>Judul Pendek</td>
					<td>:</td>
					<td><s:textfield name="initial" id="initial"
							cssClass="input-xlarge" value="%{ourBusiness.initial}"/></td>
				</tr>
				<tr>
					<td>Judul Lengkap</td>
					<td>:</td>
					<td><s:textfield name="title" id="title"
							cssClass="input-xlarge" value="%{ourBusiness.title}"/></td>
				</tr>
				<tr>
					<td>Deskripsi</td>
					<td>:</td>
					<td><s:textarea name="shortText" id="shortText"
							cssClass="input-xlarge" value="%{ourBusiness.shortText}" /></td>
				</tr>
				<tr>
					<td>Url Lebih Detail</td>
					<td>:</td>
					<td><s:textfield name="urlDetail" id="urlDetail"
							cssClass="input-xlarge" value="%{ourBusiness.urlDetail}"/></td>
				</tr>
				<tr>
					<td>Urutan Muncul</td>
					<td>:</td>
					<td><s:select list="{1,2,3,4,5,6,7,8,9,10}"
							value="%{ourBusiness.orderBy}" name="orderBy"></s:select></td>
				</tr>

				<tr>
					<td width="20%">Upload Image</td>
					<td>:</td>
					<td width="40%"><sj:a openDialog="uploadDialog"
							href="%{urlUpload}" buttonIcon="ui-icon-newwin" cssClass="btn"
							cssStyle="float:left">Ganti Gambar</sj:a> <s:hidden
							value="%{ourBusiness.fileName}" id="fileName"  name="fileName"></s:hidden></td>
					<td rowspan="6" width="40%">
						<div id="previewImg">
						<img
								src="../protected/ourbusiness/small_<s:property value="%{ourBusiness.fileName}"/>" />
						</div>
					</td>
				</tr>
			</table>
		</div>
	</div>
</s:form>
